package com.atguigu.gulimall.product.thread;

import jdk.nashorn.internal.ir.CallNode;

import java.util.concurrent.*;

public class ThreadTest {

   // public static ExecutorService service = new ThreadPoolExecutor(corePoolSize, maximumPoolSize, keepAliveTime, TimeUnit unit,workQueue, threadFactory, handler);
    public static void main(String[] args) {

        System.out.println("main...start...........");

        /*FutureTask<Integer> integerFutureTask = new FutureTask<Integer>(new Callable01());

        new Thread(integerFutureTask, "AAA").start();
        Integer i = 0;
        try {
             i = integerFutureTask.get();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        } catch (ExecutionException e) {
            throw new RuntimeException(e);
        }*/

      //  service.execute(new runable01());


        System.out.println("main...end...........");
    }


}


class runable01 implements Runnable{
    @Override
    public void run() {
        System.out.println("当前线程" + Thread.currentThread().getName());
    }
}

class Callable01 implements Callable<Integer>{
    @Override
    public Integer call() throws Exception {
        System.out.println("当前线程" + Thread.currentThread().getName());
        return 1024;
    }
}
